import { axios } from '@/utils/request'


export function selectAll(parameter) { //查询商圈
  return axios({
    url: '/coupon/company/selectAll',
    method: 'get'
  })
}

export function selectAllCategory(parameter) { //查询所有内别
  return axios({
    url: '/coupon/category/selectCategory/'+parameter,
    method: 'get'
  })
}

export function selectByCompanyId(parameter) { //查询商户
  return axios({
    url: '/coupon/merchant/selectByCompanyId/' + parameter,
    method: 'get'
  })
}

export function save(parameter) {
  return axios({
    url: '/coupon/product/addOrUpdate',
    method: 'post',
    data: parameter
  })
}

//商品上架下架
export function updateState(parameter) {
  return axios({
    url: '/coupon/product/updateState',
    method: 'post',
    data: parameter
  })
}

export function selectList(parameter) {
  return axios({
    url: '/coupon/product/selectList/' + parameter.pageNum + "/" + parameter.pageSize,
    method: 'post',
    data: parameter
  })
}

export function Delete(parameter) { //删除
  return axios({
    url: '/coupon/product/delete/' + parameter,
    method: 'get'
  })
}
//排序
export function updateSort(parameter) {
  return axios({
    url: '/coupon/product/updateSort',
    method: 'post',
    data: parameter
  })
}
export function selectStoreById(parameter) { //删除
  return axios({
    url: '/coupon/product/selectStoreById/' + parameter,
    method: 'get'
  })
}


